﻿using System;
using System.Data;
using System.Web.UI;

namespace BaoJian.Control.bj
{
    /// <summary>
    /// 互换产品
    /// </summary>
    public partial class ColType6 : UserControl
    {
        public int Count = 3;
        public int RepeatColumns = 3;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                string sql = "SELECT TOP 3  dbo.ExchangeProduct.PID,Pname,REPLACE(imagePath,'~','') AS imagePath  FROM dbo.ExchangeProduct INNER JOIN dbo.EProduct ON dbo.ExchangeProduct.PID = dbo.EProduct.PID WHERE LEN(PName) <5  ORDER BY RegDate ";
                sql = string.Format(sql, Count);
                DataTable dt = Maticsoft.DBUtility.DbHelperSQL.Query(sql).Tables[0];
                DataList1.DataSource = dt;
                DataList1.RepeatColumns = RepeatColumns;
                DataList1.DataBind();
            }
        }
    }
}